package com.czbank.financing.service.impl;

import com.czbank.financing.Entity.UserInfo;
import com.czbank.financing.mapper.UserInfoMapper;
import com.czbank.financing.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: thinkpad
 * @Date: 2019/7/12 18:51
 * @Description:
 */
@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public UserInfo SelectOneUserInfo(String username) {

        return userInfoMapper.findAllUserInfo(username);
    }

    @Override
    public int UpdateUserInfo(int id,String password) {
        return userInfoMapper.UpdateUserInfo(id, password);
    }

    @Override
    public int InsertUserInfo(String account, String username, String password) {
        return userInfoMapper.InsertUserInfo(account,username , password);
    }

    @Override
    public int DeleteUserInfo(int id) {
        return userInfoMapper.DeleteUserInfo(id);
    }

    @Override
    public UserInfo findByIdUserInfo(int id) {
        return userInfoMapper.findByIdUserInfo(id);
    }

    @Override
    public List<UserInfo> AllUserInfo() {
        System.out.println("userInfoMapper.AllUserInfo() = " + userInfoMapper.AllUserInfo());
        return userInfoMapper.AllUserInfo();
    }

    @Override
    public List<UserInfo> QueryOneUserInfo(String username) {
        return userInfoMapper.QueryOneUserInfo(username);
    }
}
